export const UserModifyPassword = (formRef, form) => {
  if (form.password === form.confirmPassword) {
    formRef.value.validate((valid) => {
      if (valid) {
        postOrdinaryUserHttp(form.username, form.password).then((response) => {
          const { code } = response.data
          if (code === 0) {
            ElMessage({
              message: '修改密码成功',
              type: 'success'
            })
            location.reload()
          }
          if (code === 1) {
            ElMessage.error('用户名已存在')
          }
        })
      }
    })
  }
}
